package com.efruit.po;

/**
 * PurchaseId entity. @author MyEclipse Persistence Tools
 */

public class PurchaseId implements java.io.Serializable {

	// Fields

	private Order order;
	private Product product;

	// Constructors

	/** default constructor */
	public PurchaseId() {
	}

	/** full constructor */
	public PurchaseId(Order order, Product product) {
		this.order = order;
		this.product = product;
	}

	// Property accessors

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PurchaseId))
			return false;
		PurchaseId castOther = (PurchaseId) other;

		return ((this.getOrder() == castOther.getOrder()) || (this.getOrder() != null
				&& castOther.getOrder() != null && this.getOrder().equals(
				castOther.getOrder())))
				&& ((this.getProduct() == castOther.getProduct()) || (this
						.getProduct() != null
						&& castOther.getProduct() != null && this.getProduct()
						.equals(castOther.getProduct())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getOrder() == null ? 0 : this.getOrder().hashCode());
		result = 37 * result
				+ (getProduct() == null ? 0 : this.getProduct().hashCode());
		return result;
	}

}